import * as Cesium from 'cesium'
import Polyline from './material/polyline'
import Spriteline from './material/spriteline'
export default class RoadLine {
  constructor(viewer){
    let geoJsonPromise = Cesium.GeoJsonDataSource.load('./geojson/path.geojson')
    geoJsonPromise.then((dataSource) => {
      viewer.dataSources.add(dataSource)
      let entities = dataSource.entities.values
      entities.forEach(item => {
        let polyline = item.polyline
        polyline.material = new Spriteline()
      })
    })
  }
}